﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ShopOnline.DAL;
namespace ShopOnline.BLL
{
    public class SlideShow : _SlideShow
    {
        public static SlideShow GetAll()
        {
            try
            {
                SlideShow slides = new SlideShow();
                slides.LoadAll();
                return slides;
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }

        public static SlideShow GetAllActive()
        {
            try
            {
                SlideShow slides = new SlideShow();
                slides.Where.Active.Value = true;
                slides.Query.AddOrderBy(SlideShow.ColumnNames.ID, MyGeneration.dOOdads.WhereParameter.Dir.DESC);
                slides.Query.Load();
                return slides;
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }

        public static SlideShow GetByID(int ID)
        {
            try
            {
                SlideShow slide = new SlideShow();
                slide.LoadByPrimaryKey(ID);
                return slide;
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
    }
}
